<html xmlns="http://www.w3.org/1999/xhtml"
	xmlns:c="http://java.sun.com/jstl/core"
	xmlns:f="http://java.sun.com/jsf/core"
	xmlns:h="http://java.sun.com/jsf/html"
	xmlns:ui="http://java.sun.com/jsf/facelets"
	xmlns:t="http://myfaces.apache.org/tomahawk"
	xmlns:v="http://corejsf.com/validator">


<f:view>
<f:loadBundle var="text" basename="#{basePage.bundleName}"/>
<head>
    <title>#{text['menu.shop.title']}</title>
    <meta name="heading" content="#{text['menu.shop.title']}"/>
</head>
<body id="addShop">

<div class="separator"></div>

<h:form id="shopForm" enctype="multipart/form-data">
	<h:inputHidden value="#{shopForm.shop.id}" id="id"/>
	<h:panelGrid columns="3">		
		<h:outputLabel for="shopName" styleClass="desc" value="#{text['user.username']}"/>
    	<t:message for="shopName" styleClass="fieldError"/>
    	<h:inputText value="#{shopForm.shop.name}" id="shopName" requiredMessage="'ShopName' is required field" required="true" styleClass="text large">
        	<v:commonsValidator type="required"/>
    	</h:inputText>
    	
    	<h:outputLabel for="shopURL" styleClass="desc" value="#{text['shop.create.url']}"/>
    	<t:message for="shopURL" styleClass="fieldError"/>
    	<h:inputText value="#{shopForm.shop.URL}" id="shopURL" requiredMessage="'Shop URL' is required field" required="true" styleClass="text large">
        	<v:commonsValidator type="required"/>
    	</h:inputText>
    	
    	<h:outputLabel for="shopDescription" styleClass="desc" value="#{text['shop.create.description']}"/>
    	<t:message for="shopDescription" styleClass="fieldError"/>
    	<h:inputTextarea cols="7" rows="5" value="#{shopForm.shop.description}" id="shopDescription" styleClass="text large"/>
    	
    	
    	<h:outputLabel styleClass="desc" for="currentLogo" value="#{text['shop.edit.logo.current']}"/>
		<t:graphicImage id="current" url="/resource/image/${shopForm.shop.logo.URI}"></t:graphicImage>
    	
    	<h:outputLabel styleClass="desc" for="file" value="#{text['shop.create.logo']}"/>
    	<t:message for="file" styleClass="fieldError"/>
    	<t:inputFileUpload id="file" value="#{shopForm.file}" storage="file" required="false" styleClass="file medium"/>    	
    	
		
	</h:panelGrid>

	<h:panelGroup styleClass="buttonBar bottom">
        <h:commandButton value="#{text['button.save']}" action="#{shopForm.createShop}" id="save" styleClass="button"/>
        <h:commandButton value="#{text['button.cancel']}" action="cancel" immediate="true" id="cancel" styleClass="button" onclick="bCancel=true"/>
    </h:panelGroup>
</h:form>
</body>
</f:view>
</html>
